<?php
include_once (dirname ( __FILE__ ) . "/../inc/common.php");

if (isset ( $_GET ["oid"] ) && $_GET ["oid"]) {
	try {
		$flowClass = new tally_flow();
		$flow = $flowClass->findFlowById ( $userId, $_GET ["oid"] );
		if ($flow) {
			$flowClass->removeFlow ( $userId, $_GET ["oid"] );
			$result = array (
					"returnCode" => 0,
					"returnMsg" => "删除成功" 
			);
		} else {
			throw new flowException ( "此记录不存在" );
		}
	} catch ( Exception $e ) {
		$result = array (
				"returnCode" => 2,
				"returnMsg" => $e->getMessage () ? $e->getMessage () : "删除失败" 
		);
	}
} else {
	$result = array (
			"returnCode" => 1,
			"returnMsg" => "参数错误" 
	);
}
$jsonHandle = new ext_jsonHandle ();
$jsonHandle->jsonOut ( $result );
exit ();